package org.witsoft.dtx.component;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @author XiaoQing Lin
 * @date 2020-12-04 18:19
 */
public class TransactionManageRunner implements InitializingBean, DisposableBean {

    @Autowired
    private TransactionManageScheduler scheduler;

    @Override
    public void afterPropertiesSet() throws Exception {
        scheduler.start();
    }

    @Override
    public void destroy() throws Exception {
        scheduler.shutdown();
    }
}
